www.gusucode.com > VC 2D游戏编辑器-源码程序 > VC 2D游戏编辑器-源码程序/code/mapedit_source/dialog/Property.cpp

    //Download by http://www.NewXing.com
// Property.cpp : implementation file
//

#include "stdafx.h"
#include "..\\MapEdit.h"
#include "Property.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CProperty dialog


CProperty::CProperty(CWnd* pParent /*=NULL*/)
	: CDialog(CProperty::IDD, pParent)
{
	//{{AFX_DATA_INIT(CProperty)
	m_height = 0;
	m_pass = FALSE;
	m_height_used = FALSE;
	m_id_used = FALSE;
	m_type = 0;
	m_id = 0;
	m_type_used = FALSE;
	m_pass_used = FALSE;
	m_realy = 0;
	m_realy_used = FALSE;
	//}}AFX_DATA_INIT
}


void CProperty::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CProperty)
	DDX_Control(pDX, IDC_STATIC_REALY1, m_static_realy1C);
	DDX_Control(pDX, IDC_STATIC_REALY, m_static_realyC);
	DDX_Control(pDX, IDC_REALY, m_realyC);
	DDX_Control(pDX, IDC_REALY_USED, m_realy_usedC);
	DDX_Control(pDX, IDC_STATIC3, m_static3C);
	DDX_Control(pDX, IDC_STATIC2, m_static2C);
	DDX_Text(pDX, IDC_HEIGHT, m_height);
	DDV_MinMaxInt(pDX, m_height, 0, 31);
	DDX_Check(pDX, IDC_PASS, m_pass);
	DDX_Check(pDX, IDC_HEIGHT_USED, m_height_used);
	DDX_Check(pDX, IDC_ID_USED, m_id_used);
	DDX_Text(pDX, IDC_TYPE, m_type);
	DDV_MinMaxInt(pDX, m_type, 0, 7);
	DDX_Text(pDX, IDC_ID, m_id);
	DDV_MinMaxInt(pDX, m_id, 0, 127);
	DDX_Check(pDX, IDC_TYPE_USED, m_type_used);
	DDX_Check(pDX, IDC_PASS_USED, m_pass_used);
	DDX_Text(pDX, IDC_REALY, m_realy);
	DDX_Check(pDX, IDC_REALY_USED, m_realy_used);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CProperty, CDialog)
	//{{AFX_MSG_MAP(CProperty)
	ON_BN_CLICKED(IDC_HEIGHT_USED, OnHeightUsed)
	ON_BN_CLICKED(IDC_REALY_USED, OnRealxUsed)
	ON_BN_CLICKED(IDC_TYPE_USED, OnTypeUsed)
	ON_BN_CLICKED(IDC_ID_USED, OnIdUsed)
	ON_BN_CLICKED(IDC_PASS_USED, OnPassUsed)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProperty message handlers



void CProperty::OnHeightUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_HEIGHT)->IsWindowEnabled())
	{
		GetDlgItem(IDC_HEIGHT)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_HEIGHT)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_HEIGHT)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_HEIGHT)->EnableWindow(TRUE);
	}	
}

void CProperty::OnRealxUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_REALY)->IsWindowEnabled())
	{
		GetDlgItem(IDC_REALY)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_REALY)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_REALY1)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_REALY)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_REALY)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_REALY1)->EnableWindow(TRUE);
	}
}

void CProperty::OnTypeUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_TYPE)->IsWindowEnabled())
	{
		GetDlgItem(IDC_TYPE)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_TYPE)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_TYPE)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_TYPE)->EnableWindow(TRUE);
	}
}

void CProperty::OnIdUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ID)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ID)->EnableWindow(FALSE);
		GetDlgItem(IDC_STATIC_ID)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ID)->EnableWindow(TRUE);
		GetDlgItem(IDC_STATIC_ID)->EnableWindow(TRUE);
	}
}

void CProperty::OnPassUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_PASS)->IsWindowEnabled())
	{
		GetDlgItem(IDC_PASS)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_PASS)->EnableWindow(TRUE);
	}
}